﻿using Container;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Proba
{
    public partial class Form1 : Form, IMainView
    {
        public Form1()
        {
            InitializeComponent();
            btn1.Click += (sender, args)=>Invoke(btn1Clicked);

        }


        public event Action btn1Clicked;


        public string ProdName
        {
            get
            {
                return txt1.Text;
            }
            set
            {
                txt1.Text = value;
            }
        }
        public ICollection<User> huita
        {
            set
            {
                dataGrid1.DataSource = value;
                dataGrid1.AutoResizeColumns();
            }
            
        }
        
        private void Invoke(Action action)
        {
            if (action != null)
            {
                action();
            }
        }
        public new void Show()
        {
            Application.Run(this);
        }

        private void btn1_Click(object sender, EventArgs e)
        {

        }
                                      
    }
}
